<template>
  <div>
    <a-button type="primary" html-type="submit" @click="rmb">
      人民币钱包
    </a-button>
    <p>人民币金额: {{rmbmoney}}</p>
    <a href="/#/payment">充值人民币</a><br>

    <br><br>
    <a-button type="primary" html-type="submit" @click="mj">
      美金钱包
    </a-button>
    <p>美金金额: {{mjmoney}}</p>
    <a :href="mj_url">充值美金</a>

    <br><br>
    <a href="/#/rmborder">查看账单</a>

  </div>
</template>

<script>
export default {
  name: "index",
  data(){
    return{
      uid:localStorage.getItem("uid"),
      mjmoney:'',
      rmbmoney:'',
      mj_url:'',
    }
  },
  methods:{
    rmb(){
      this.$axios({
        url:'/z/wx_pay/?uid='+this.uid,
        method:'put',
      }).then(res =>{
        this.rmbmoney = res.data
      })
    },
    mj(){
      this.$axios({
        url:'/z/mj/?uid='+this.uid,
      }).then(res =>{
        this.mjmoney=res.data
      })
    },
  },
  created(){
    this.$axios({
      url:'/z/payment/?uid='+localStorage.getItem('uid')
    }).then(res =>{
      this.mj_url = res.data
    })
  }
}
</script>

<style scoped>

</style>
